package com.work.mdass.util;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/*
 * 修改spring boot 默认WeMvc配置路径
 */
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter {

	/*
	 * 暴漏static目录下所有静态资源
	 */
	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		
		registry.addResourceHandler("static/**").addResourceLocations("classpath:/static/");
		registry.addResourceHandler("templates/**").addResourceLocations("classpath:/templates/");
		
	}
}
